#include "TestGameState.h"
#include "../Common/Common.h"
#include "Character/PlayerChara.h"
#include "../DungeonGenerator/NormalDungeonGenerator.h"
#include "../Map/MapActionManager.h"
#include "DxLib.h"

// ------------------------------ //

TestGameState::TestGameState(GameStateType::States type)
	: IGameState( type )
	//, m_actionManager( m_map )
	, m_pPlayerOne( NULL )
	, m_pPlayerTwo( NULL )
{
	//m_generator = std::make_shared<NormalDungeonGenerator>(m_map);
	//m_map = m_generator->Generate();
}

// ------------------------------ //

TestGameState::~TestGameState(void)
{
	//if ( m_pPlayerOne != NULL )
	//{
	//	delete m_pPlayerOne;
	//}

	//if ( m_pPlayerTwo != NULL )
	//{
	//	delete m_pPlayerTwo;
	//}

	//m_charaManager.Clear();
}

// ------------------------------ //

void TestGameState::OnEnter( GameStateType::States previousState )
{
	UNUSED_VARIABLE( previousState );
	//int cowTexHandle = LoadGraph( "../TestResource/cow.png" );
	//int mouseTexHandle = LoadGraph( "../TestResource/mouse.png" );

	//if ( cowTexHandle == -1 || mouseTexHandle == -1 )
	//{
	//	ASSERT( 0 );
	//}

	//Character::Parameter param1;
	//param1.Attack = 1;
	//param1.Level = 1;
	//param1.HP = 10;

	//Character::Parameter param2;
	//param2.Attack = 1;
	//param2.Level = 1;
	//param2.HP = 10;

	//m_charaManager.CraetePlayerChara( GameDefine::PLAYER_ONE, param1, Point::ZERO, Vector2( 100, 100 ), mouseTexHandle );
	//m_charaManager.CraetePlayerChara( GameDefine::PLAYER_TWO, param2, Point::ZERO, Vector2( 100, 150 ), cowTexHandle );

	//m_pPlayerOne = new PlayerChara( GameDefine::PLAYER_ONE, param1, Point::ZERO, Vector2( 100, 100 ), mouseTexHandle );
	//m_pPlayerTwo = new PlayerChara( GameDefine::PLAYER_TWO, param2, Point::ZERO, Vector2( 100, 150 ), cowTexHandle );

	//MapActionManager* pActionManager = MapActionManager::GetInstancePtr();
	//pActionManager->SetPlayer( m_pPlayerOne );
	//pActionManager->SetPlayer( m_pPlayerTwo );
}

// ------------------------------ //

void TestGameState::OnExit( GameStateType::States nextState )
{
	UNUSED_VARIABLE( nextState );
}

// ------------------------------ //

void TestGameState::Update( float delta )
{
	//m_charaManager.Update( delta );
	//m_actionManager.Update( delta );
}

// ------------------------------ //

void TestGameState::Draw( float delta )
{
	m_map->Draw();
	//m_charaManager.Draw();
	//m_actionManager.Draw();
}




